FROM m.daocloud.io/docker.io/library/python:3.9-slim

WORKDIR /app

# 设置pip镜像源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
    && pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn

# 复制依赖文件并安装
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 复制应用代码
COPY main.py ./

# 暴露端口
EXPOSE 8000

# 启动命令
CMD ["python", "main.py"] 